window.onload = async function () {
  const res = await axios({
    url: '/dashboard',
    method: 'get',
    headers: {
      Authorization: localStorage.getItem('token'),
    },
  })
  console.log('res:', res)
}
const fn = async () => {
  const res = await axios({
    url: '/dashboard',
    method: 'GET',
  })
  // console.log(res)
  const {
    data: { overview },
  } = res
  salary = document.querySelector('[name=salary]')
  student_count = document.querySelector('[name=student_count]')
  age = document.querySelector('[name=age]')
  group_count = document.querySelector('[name=group_count]')
  // console.log(salary)
  salary.innerHTML = overview.salary
  student_count.innerHTML = overview.student_count
  age.innerHTML = overview.age
  group_count.innerHTML = overview.group_count
}
fn()
